package com.manager.sms;

import java.util.List;

import com.application.yfsmsrecord.entity.YfSmsrecord;

public class SmsSend33d9Impl implements SmsSend {
	private MsgSend smsSend = new MsgSend();
	@Override
	public boolean start() {
		return smsSend.start();
	}

	@Override
	public void stop() {
		smsSend.stop();
		
	}

	public List<YfSmsrecord> sendSms(List<YfSmsrecord> smsRecordList) {
		for (YfSmsrecord yfSmsrecord : smsRecordList) {
			seneSms(yfSmsrecord);
		}
		return smsRecordList;
	}


	public YfSmsrecord seneSms(YfSmsrecord yfSmsrecord) {
		// 单发
		SmsBean smsBean = new SmsBean();
		smsBean.sequence = yfSmsrecord.getId().intValue();
		smsBean.phones = new String[] {yfSmsrecord.getReceNo()};
		smsBean.content = yfSmsrecord.getSendContent();
		smsBean.prefix = yfSmsrecord.getWorkitmeId();
		smsSend.sendQueue.push(smsBean);
		return yfSmsrecord;
	}

}
